﻿﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>${product.name} - ${web.name}${web.additionalTitle!}</title>
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
function addToCart(productId,count,isAdd) {
	if(!Core.username()) {
		location.href='${loginUrl}';
		return;
	}
	$.post('${base}/add_to_cart.jspx', {
		'productId' : productId,
		'count' : count,
		'isAdd' : isAdd
	}, function(data) {
		if(data.status==1) {
			location.href='${base}/shopping_cart.jspx?backUrl=${location}';
		} else if(data.status==0) {
			location.href='${loginUrl}';
		} else {
			alert('error code: ' + data.status);
		}
	},'json');
}
</script>
</head>
<body>
[#include 'inc_head.html'/]
<p>当前位置：<a href="${base}/">首页</a>[#list category.categoryList as ctg] - <a href="${ctg.url}">${ctg.name}</a>[/#list] - <a href="${product.url}">${product.name}</a></p>
<h1>${product.name}</h1>
<div style="float:left"><img src="${product.detailImgUrl!}"/></div>
<div style="float:left">
市场价：${product.marketPrice!}<br/>
销售价：${product.salePrice!}<br/>
[#if product.prohibit]
		[#if product.onSale]
		<input type="button" value="加入购物车" onclick="addToCart(${product.id},1,true);"/>   
		[#else]
		   <font color="red" size="20">商品已下架</font>
		[/#if]
		
		[#else] <font color="red" size="20">商品已禁售</font>
		   [/#if]
</div>
<div style="clear:both">
${product.text!}
</div>
</body>
</html>